﻿using System.Windows.Controls;
using System.Windows;

namespace NavFx
{
	/// <summary>
	/// Base page for pages within a silverlight application
	/// </summary>
	public class Page: UserControl, IPage
	{

		#region IPage Members

		/// <summary>
		/// Path of the page in the page hierarchy
		/// </summary>
		/// <remarks>
		/// Used by Navigator as a Key into the dictionary used as a page cache
		/// </remarks>
		public string Path
		{
			get
			{
				return this.GetType().Name;
			}
		}

		/// <summary>
		/// Indicates if the page should be left in the Page cache if not cleared with explicit request to remove Pinned pages
		/// </summary>
		public virtual bool IsPinned
		{
			get;
			set;
		}

		#endregion


		/// <summary>
		/// Providing this in an attempt to eliminate warnings about non existence of Content property
		/// </summary>
		public new UIElement Content
		{
			get
			{
				return base.Content;
			}

			set
			{
				base.Content = value;
			}
		}

		/// <summary>
		/// Default constructor required for use as an element
		/// </summary>
		public Page()
			: base()
		{
			this.IsPinned = false;
		}
	}
}
